package test.socket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

import org.apache.log4j.Logger;

public class ClientThread implements Runnable {

	private final static Logger LOG = Logger.getLogger(ClientThread.class);
	Socket socket = null;
	BufferedReader br = null;
	
	public ClientThread(Socket socket) throws IOException {
		this.socket = socket;
		br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
	}

	public void run() {
		try {
			String content = null;
			while((content = br.readLine()) != null) {
				LOG.info(content);
			}
		} catch (Exception e) {
			LOG.info(e);
		}
	}
}